{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('./Data/ml-1m.train.rating') as f:\n",
    "    data_train = f.readlines()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['0\\t32\\t4\\t978824330\\n',\n",
       " '0\\t34\\t4\\t978824330\\n',\n",
       " '0\\t4\\t5\\t978824291\\n',\n",
       " '0\\t35\\t4\\t978824291\\n',\n",
       " '0\\t30\\t4\\t978824291\\n']"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_train[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('./Data/ml-1m.test.rating') as f:\n",
    "    data_test = f.readlines()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['0\\t25\\t5\\t978824351\\n',\n",
       " '1\\t133\\t3\\t978300174\\n',\n",
       " '2\\t207\\t4\\t978298504\\n',\n",
       " '3\\t208\\t4\\t978294282\\n',\n",
       " '4\\t222\\t2\\t978246585\\n']"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_test[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('./Data/ml-1m.test.negative') as f:\n",
    "    data_neg = f.readlines()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['(0,25)\\t1064\\t174\\t2791\\t3373\\t269\\t2678\\t1902\\t3641\\t1216\\t915\\t3672\\t2803\\t2344\\t986\\t3217\\t2824\\t2598\\t464\\t2340\\t1952\\t1855\\t1353\\t1547\\t3487\\t3293\\t1541\\t2414\\t2728\\t340\\t1421\\t1963\\t2545\\t972\\t487\\t3463\\t2727\\t1135\\t3135\\t128\\t175\\t2423\\t1974\\t2515\\t3278\\t3079\\t1527\\t2182\\t1018\\t2800\\t1830\\t1539\\t617\\t247\\t3448\\t1699\\t1420\\t2487\\t198\\t811\\t1010\\t1423\\t2840\\t1770\\t881\\t1913\\t1803\\t1734\\t3326\\t1617\\t224\\t3352\\t1869\\t1182\\t1331\\t336\\t2517\\t1721\\t3512\\t3656\\t273\\t1026\\t1991\\t2190\\t998\\t3386\\t3369\\t185\\t2822\\t864\\t2854\\t3067\\t58\\t2551\\t2333\\t2688\\t3703\\t1300\\t1924\\t3118\\n',\n",
       " '(1,133)\\t1072\\t3154\\t3368\\t3644\\t549\\t1810\\t937\\t1514\\t1713\\t2186\\t660\\t2303\\t2416\\t670\\t1176\\t788\\t889\\t3120\\t2344\\t2525\\t3301\\t2055\\t1436\\t2630\\t11\\t2773\\t2176\\t1847\\t740\\t2332\\t3561\\t263\\t3658\\t3282\\t1980\\t2093\\t3287\\t3190\\t3475\\t569\\t2315\\t1442\\t592\\t546\\t3133\\t1852\\t2648\\t934\\t337\\t483\\t1017\\t3452\\t467\\t1183\\t1765\\t601\\t2413\\t2602\\t2801\\t2976\\t918\\t753\\t3540\\t3341\\t2973\\t1580\\t2118\\t3511\\t526\\t1719\\t525\\t1520\\t486\\t557\\t1353\\t500\\t2902\\t1687\\t1295\\t2997\\t2415\\t797\\t2518\\t926\\t3537\\t1746\\t1676\\t1875\\t3029\\t1535\\t341\\t3525\\t1429\\t2225\\t1628\\t2061\\t469\\t3056\\t2553\\n',\n",
       " '(2,207)\\t2216\\t209\\t2347\\t3\\t1652\\t3397\\t383\\t2905\\t2284\\t2866\\t584\\t783\\t3208\\t1534\\t2529\\t1907\\t1170\\t3037\\t2015\\t1045\\t3099\\t3298\\t2522\\t739\\t2652\\t3702\\t792\\t2527\\t1945\\t2333\\t1668\\t3511\\t70\\t1991\\t3071\\t2474\\t1629\\t3221\\t505\\t3266\\t1475\\t515\\t2704\\t1717\\t569\\t3248\\t241\\t2643\\t2137\\t2336\\t2627\\t2618\\t2748\\t2967\\t2579\\t1732\\t3283\\t1440\\t1052\\t1906\\t1812\\t1182\\t2831\\t1548\\t1630\\t2227\\t2352\\t760\\t350\\t302\\t791\\t300\\t3528\\t1444\\t2\\t798\\t997\\t376\\t2565\\t1565\\t718\\t710\\t2695\\t904\\t3643\\t655\\t3666\\t3069\\t3661\\t953\\t865\\t813\\t1353\\t2945\\t2580\\t2989\\t2790\\t2879\\t2481\\n',\n",
       " '(3,208)\\t3023\\t1489\\t1916\\t1706\\t1221\\t1191\\t2671\\t81\\t2483\\t941\\t841\\t1617\\t1437\\t2700\\t1904\\t1763\\t1181\\t599\\t2442\\t1656\\t1370\\t1171\\t1372\\t1444\\t1596\\t2023\\t1456\\t2179\\t530\\t1949\\t2628\\t290\\t1996\\t2593\\t2489\\t3484\\t1035\\t2826\\t1274\\t595\\t1151\\t634\\t435\\t2738\\t3013\\t2605\\t3401\\t3595\\t2450\\t2052\\t15\\t501\\t1958\\t988\\t1920\\t1798\\t604\\t2793\\t2063\\t3655\\t3073\\t557\\t2007\\t1937\\t2244\\t55\\t1016\\t2382\\t2506\\t3501\\t914\\t3127\\t23\\t3187\\t799\\t2572\\t1038\\t3028\\t2619\\t1429\\t2623\\t2158\\t2785\\t3674\\t2578\\t1837\\t1689\\t296\\t959\\t3347\\t1707\\t2901\\t2767\\t2167\\t1921\\t247\\t1618\\t2016\\t2323\\n',\n",
       " '(4,222)\\t1794\\t3535\\t108\\t593\\t466\\t2048\\t854\\t1378\\t1301\\t697\\t1376\\t22\\t2135\\t3657\\t3173\\t1322\\t976\\t6\\t1399\\t817\\t2757\\t2010\\t652\\t458\\t1227\\t204\\t592\\t2875\\t1930\\t2251\\t1654\\t2542\\t1149\\t3089\\t454\\t2466\\t3461\\t1770\\t3106\\t2275\\t1100\\t906\\t1814\\t421\\t2418\\t866\\t3607\\t821\\t213\\t432\\t34\\t2578\\t2517\\t2221\\t2818\\t2420\\t2738\\t2141\\t3013\\t3610\\t959\\t1927\\t2524\\t932\\t3327\\t187\\t2575\\t1674\\t557\\t2547\\t1572\\t776\\t1600\\t2682\\t2085\\t1987\\t1390\\t614\\t3098\\t1831\\t927\\t2285\\t1059\\t2850\\t3517\\t134\\t1852\\t2776\\t1694\\t2490\\t1332\\t2526\\t2804\\t2027\\t833\\t176\\t463\\t2851\\t2453\\n']"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_neg[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "100"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(data_neg[0].split('\\t'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'(0,25)'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_neg[0].split('\\t')[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
